package com.cq.hd.system.controller;


import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.system.api.TbHfRegionsApi;
import com.cq.hd.system.api.vo.HfRegionVo;
import com.cq.hd.system.service.TbHfRegionsService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 汇付省市区表 前端控制器
 * </p>
 *
 * @author mYunYu
 * @since 2023-12-25
 */
@RestController
public class TbHfRegionsController implements TbHfRegionsApi {

    @Autowired
    private TbHfRegionsService hfRegionsService;

    @ApiOperation(value = "根据id获取汇付的省市区列表数据")
    @ApiImplicitParam(name = "id", value = "id:0：获取省份，其他id：获取市区数据", defaultValue = "0", paramType = "query", dataType = "Integer")
    @ApiResponse(response = HfRegionVo.class, code = 200, message = "接口返回对象参数")
    @Override
    public Result<List<HfRegionVo>> listHfRegionById(Integer id) {
        return ResultGenerator.success(hfRegionsService.listHfRegionById(id));
    }

    @ApiOperation(value = "根据城市名称获取省市列表数据")
    @Override
    public Result<List<HfRegionVo>> listHfRegionByCityNames(Set<String> cityNames) {
        return ResultGenerator.success(hfRegionsService.listHfRegionByCityNames(cityNames));
    }

    @ApiOperation(value = "获取汇付的省市列表所有数据")
    @Override
    public Result<List<HfRegionVo>> listAllRegion() {
        return ResultGenerator.success(hfRegionsService.listAllRegion());
    }

}
